<?php
class LoginForm_Controller {
	
	public $template;
	
	public function main(array $getVars){
		$loginFormModel = new LoginForm_Model;
		$session = new Session_Core();
		$data = $session->isLoggedIn();
		$article = $loginFormModel->getArticle($data);
		if($data['access_level'] >= $article['module_access_level']){
			$this->template = $article['module_templatename'];
			$view = new View_Core($this->template);
			$view->assign('article', $article);
		}
		else {
			header("Location: 500.html");
		}
	}
}